﻿using AIStudio.Core;
using AIStudio.Wpf.AvalonDockMVVM.ViewModels;
using AIStudio.Wpf.D_Manage.Views;
using AIStudio.Wpf.BasePage.ViewModels;
using AIStudio.Wpf.PetaPoco;
using AIStudio.Wpf.Service.AppClient;
using AIStudio.Wpf.Service.IAppClient;
using CommonServiceLocator;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Windows.Input;
using Util.Controls;
using Util.Controls.DialogBox;

namespace AIStudio.Wpf.D_Manage.ViewModels
{
    public class D_UserMailIndexViewModel : DockWindowViewModel
    {
        private D_UserMailNewViewModel _newViewModel;
        public D_UserMailNewViewModel NewViewModel
        {
            get { return _newViewModel; }
            set
            {
                if (_newViewModel != value)
                {
                    _newViewModel = value;
                    OnPropertyChanged("NewViewModel");
                }
            }
        }


        private D_UserMailViewModel _sendViewModel;
        public D_UserMailViewModel SendViewModel
        {
            get { return _sendViewModel; }
            set
            {
                if (_sendViewModel != value)
                {
                    _sendViewModel = value;
                    OnPropertyChanged("SendViewModel");
                }
            }
        }

        private D_UserMailViewModel _receiveViewModel;
        public D_UserMailViewModel ReceiveViewModel
        {
            get { return _receiveViewModel; }
            set
            {
                if (_receiveViewModel != value)
                {
                    _receiveViewModel = value;
                    OnPropertyChanged("ReceiveViewModel");
                }
            }
        }

        private D_UserMailViewModel _draftViewModel;
        public D_UserMailViewModel DraftViewModel
        {
            get { return _draftViewModel; }
            set
            {
                if (_draftViewModel != value)
                {
                    _draftViewModel = value;
                    OnPropertyChanged("DraftViewModel");
                }
            }
        }

        public D_UserMailIndexViewModel()
        {
            NewViewModel = new D_UserMailNewViewModel();
            SendViewModel = new D_UserMailViewModel(1);
            ReceiveViewModel = new D_UserMailViewModel(2);
            DraftViewModel = new D_UserMailViewModel(3);
        }

        public D_UserMailIndexViewModel(string[] id)//无效参数，做个标记
        {
            SendViewModel = new D_UserMailViewModel(id);
        }


        public void EditById(object[] id)
        {
            SendViewModel.EditById(id);
        }
    }
}
